﻿
using UnityEngine;

public  class DeathState : IState
{
    public DeathState(FSM manager)
    {
        this.manager = manager;
        this.parameter = manager.parameter;
    }
    public override void OnEnter()
    {
        parameter.animator.Play("Dead");
    }

    public override void OnUpdate()
    {
        // 如果动画播放进度超过95%，销毁敌人
        if (parameter.animatorStateInfo.normalizedTime >= 0.95f)
        {
            manager.Destroy();
        }
    }

    public override void OnFixedUpdate()
    {
        
    }

    public override void OnExit()
    {

    }

}